home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13517 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.1 KB  |  55 lines

  1. Path: news.clark.net!usenet
  2. From: budge@clark.net (Joe Budge)
  3. Newsgroups: comp.lang.c++
  4. Subject: BC++ 4.52 - A CodeGuard bug, or mine?
  5. Date: 25 Mar 1996 20:06:18 GMT
  6. Organization: Clark Internet Services, Inc.
  7. Message-ID: <4j6ubq$24l@clarknet.clark.net>
  8. NNTP-Posting-Host: budge.clark.net
  9. Mime-Version: 1.0
  10. X-Newsreader: WinVN 0.93.14
  11.  
  12. I am experiencing a sporadic error message from CodeGuard which
  13. makes no sense to me.  Any tips that anyone can provide as to
  14. what the cause may be or how I may narrow this down would be
  15. greatly appreciated.
  16.  
  17. I'm building an application under BCPP 4.53 for Windows 3.11
  18. using the large memory model.  At inconsistent times CodeGuard
  19. interrupts with a 'Bad Parameter' message: 'A bad object
  20. (0x00000000) has been passed to the function. delete(0xhhhh:hhhh)"
  21. [Where h = address of delete() in my .exe].  The lowest level
  22. of the call stack with source code always points to the line
  23. containing the 'new' operator in one of several code fragments
  24. that look like:
  25.  
  26.     char * szDest ;
  27.     szDest = new char[n + 1] ;
  28.     assert( szDest != NULL ) ;
  29.  
  30. This is puzzling, as I am not calling delete() anywhere that I
  31. can tell in the flagged code (yes, I do call it elsewhere).  I
  32. can't find anywhere that the BC++ source for operator new() calls
  33. delete() either.
  34.  
  35. In the above fragment, 'n' is of type size_t and is passed to the
  36. function containing the code fragment as a parameter.  There doesn't
  37. seem to be any relationship between its value and the failure.
  38.  
  39. If I set a breakpoint on the offending line or break elsewhere and
  40. set watches on either of the variables involved, the failure never
  41. occurs.  This means I can't tell what's really going on.  I've tried
  42. initializing szDest to different values - doesn't make a difference.
  43.  
  44. Of course I've checked the installation of CodeGuard.  There is
  45. no apparent problem if I build & run without CodeGuard, and there's
  46. no apparent problem if I build & run for 32-bit windows.  Now I'm at
  47. wit's end and am beginning to suspect that the problem is in
  48. CodeGuard, not in anything I've done.  Any suggestions would be
  49. greatly appreciated.
  50.  
  51. Thanks in advance,
  52. Joe Budge
  53.  
  54.  
  55.